package com.block.account.enums;

import cn.hutool.core.util.StrUtil;
import lombok.Getter;

@Getter
public enum AccountTypeEnum {

    MERCHANT("MERCHANT", "商户")
    ,PRODUCT("PRODUCT", "产品")
    ,CHANNEL("CHANNEL", "渠道")
    ,ACCOUNT("ACCOUNT", "总账户")
    ;

    private String value;
    private String name;

    AccountTypeEnum(String value, String name){
        this.value = value;
        this.name = name;
    }

    public static AccountTypeEnum getEntityByType(String actionType){
        for (AccountTypeEnum typeEnum : values()) {
            if (StrUtil.equals(typeEnum.getValue(), actionType)){
                return typeEnum;
            }
        }
        return null;
    }

}
